package com.example.mobile2121606109ycg0322homework;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

    private TextView tvMainTitle;
    private EditText edtTxtMainZH;
    private EditText edtTxtMainPSW;
    private EditText edtTxtMainRePSW;
    private Button btnMainZC;
    private EditText edtTxtMainOPSW;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        btnMainZC.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String account = edtTxtMainZH.getText().toString();
                String psw = edtTxtMainPSW.getText().toString();
                String rePSW = edtTxtMainRePSW.getText().toString();
                String oPSW = edtTxtMainOPSW.getText().toString();

                Log.i("TAG", "账号: " + account + "，旧密码： " + oPSW + "，新密码：" + psw + "，再次输入密码：" + rePSW);
            }
        });
    }

    private void initView() {
        tvMainTitle = (TextView) findViewById(R.id.tvMainTitle);
        edtTxtMainZH = (EditText) findViewById(R.id.edtTxtMainZH);
        edtTxtMainPSW = (EditText) findViewById(R.id.edtTxtMainPSW);
        edtTxtMainRePSW = (EditText) findViewById(R.id.edtTxtMainRePSW);
        btnMainZC = (Button) findViewById(R.id.btnMainZC);
        edtTxtMainOPSW = (EditText) findViewById(R.id.edtTxtMainOPSW);
    }
}